package excelParseCallback;

/**
 * @author Dengyx
 *
 */
public class User extends PoiResult{
	String id = "";
	String name = "";
	String tel = "";
	String area = "";
	String company = "";
	String position = "";
	String settle_tel = "";
	String chuanzhen = "";
	String address = "";
	String major = "";
	String bakup = "";
	String savetime = "";
	String createuserid = "";
	
	public User(String area, String createuserid) {
		super();
		this.area = area;
		this.createuserid = createuserid;
	}

	@Override
	public String toString() {
		return "User [address=" + address + ", area=" + area + ", bakup="
				+ bakup + ", chuanzhen=" + chuanzhen + ", company=" + company
				+ ", createuserid=" + createuserid + ", major=" + major
				+ ", name=" + name + ", position=" + position + ", savetime="
				+ savetime + ", settle_tel=" + settle_tel + ", tel=" + tel
				+ "]";
	}
	
	public String saveEntity() {   
		return "insert into t_whhy " +
				"(id, username, tel, area_code, savetime, createuserid, company, position, settle_tel, major, bakup, chuanzhen, address) " +
				"values " + 
				"('" + id + "','" + name + "','" + tel + "','" + area + "','" + savetime + "','" + createuserid + "','" + company + "','" + position + "','" + settle_tel + "','" + major + "','" + bakup + "','" + chuanzhen + "','" + address + "');";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((tel == null) ? 0 : tel.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (tel == null || "".equals(tel.trim())) {
			if (other.tel != null)
				return false;
		} else if (!tel.equals(other.tel))
			return false;
		return true;
	}
}
